<!DOCTYPE html>
<html lang="en">
<script type="text/javascript" src="../addons/mx_shop/plugin/static/js/jquery-3.2.1.min.js"></script>
<head>
    <meta charset="UTF-8">
    <title>CGC订单流水</title>
    <style>
        td{
            text-align: center;
            height: 23px;
        }
    </style>
</head>
<body>
<div>
    <table>
        <thead>
            <th width="250px">订单号</th>
            <th width="100px">订单金额</th>
            <th width="120px">买家</th>
            <th width="120px">电话</th>
            <th width="120px">威赢家佣金</th>
            <th width="120px">联营企业佣金</th>
            <th width="120px">省级运营商佣金</th>
            <th width="120px">区域运营商佣金</th>
            <th width="120px">行业服务商佣金</th>
            <th width="200px">下单时间</th>
        </thead>
        <tbody id="data">
        </tbody>
    </table>
</div>
</body>
<script>
    $(function () {
        getData();
        setInterval(getData,2000);
    });

    function getData(){
        $.ajax({
            type: "post",
            url: "{php echo webUrl('sorder/datatab/ajaxgetorder')}",
            dataType:"json",
            success: function(data){

                if(data.status == 1){

                    var list = data.result.data;
                    var _html = '';
                    for(var i in list){
                        _html += '<tr><td>'+list[i].ordersn+'</td>';
                        _html += '<td>'+list[i].realprice+'</td>';
                        _html += '<td><div style="width:100%;height:23px;overflow: hidden">'+list[i].realname+'</div></td>';
                        _html += '<td>'+list[i].mobile+'</td>';
                        _html += '<td>'+list[i].wyj+'</td>';
                        _html += '<td>'+list[i].qiye+'</td>';
                        _html += '<td>'+list[i].shengji+'</td>';
                        _html += '<td>'+list[i].quyu+'</td>';
                        _html += '<td>'+list[i].qudao+'</td>';
                        _html += '<td>'+list[i].date+'</td></tr>';
                    }

                    $('#data').html(_html);

                }else{
                    alert('数据加载失败')
                }
            }
        });
    }
</script>
</html>